CREATE TABLE [dbo].[TCMOVI_CAIN]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_CAJA] [dbo].[TD_VC_008] NOT NULL,
[AA_CAJA] [dbo].[TD_VC_004] NOT NULL,
[MM_CAJA] [dbo].[TD_VC_002] NOT NULL,
[TI_MOVI] [dbo].[TD_VC_001] NOT NULL,
[NU_COMP_CAJA] [dbo].[TD_VC_008] NOT NULL,
[NU_PROC] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TCMOVI_CA__NU_PR__1A9EF37A] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCMOVI_CA__CO_US__1B9317B3] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCMOVI_CA__FE_US__1C873BEC] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCMOVI_CA__CO_US__1D7B6025] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCMOVI_CA__FE_US__1E6F845E] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCMOVI_CAIN] ADD CONSTRAINT [PK__TCMOVI_C__049B17662902ECC1] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA], [NU_PROC]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCMOVI_CAIN] ADD CONSTRAINT [FK__TCMOVI_CAIN__0EF901FB] FOREIGN KEY ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA]) REFERENCES [dbo].[TCMOVI_CAJA] ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [TI_MOVI], [NU_COMP_CAJA])
GO
